package com.psp.sp.util.mail;

import com.psp.sp.constants.Author;
import com.psp.sp.constants.ConfigConstants;

public class MailSendUtil {
	public static boolean sendMail(String toEamil, String theme, String content) {
		MailSenderInfo mailInfo = new MailSenderInfo();
		mailInfo.setMailServerHost("smtp.163.com");
		mailInfo.setMailServerPort("25");
		mailInfo.setValidate(true);
		Author auth = ConfigConstants.getInstance().getString("email");
		mailInfo.setUserName(auth.getKey());
		mailInfo.setPassword(auth.getCode());

		mailInfo.setFromAddress(auth.getKey());
		mailInfo.setToAddress(toEamil);

		mailInfo.setSubject(theme);
		mailInfo.setContent(content);

		SimpleMailSender sms = new SimpleMailSender();
		return sms.sendHtmlMail(mailInfo);
	}
}
